<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>沟通记录详情</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body>
        <form id="cst_comm_rec_form">
            <div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
                <div class="fieldBox col_50">
                    <div class="label">沟通时间</div>
                    <div class="field">
                        <span id="commDt" name="commDt"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">沟通方式</div>
                    <div class="field">
                         <span id="commWayCd" name="commWayCd"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">责任人</div>
                    <div class="field">
                        <span id="respPsn" name="respPsn"></span>
                    </div>
                </div>
                <div class="fieldBox col_50">
                    <div class="label">联系人</div>
                    <div class="field">
                        <span id="linkman" name="linkman"></span>
                    </div>
                </div> 
                <div class="fieldBox col_50">
                    <div class="label">联系电话</div>
                    <div class="field">
                        <span id="contactNum" name="contactNum"></span>
                    </div>
                </div>                                 
                <div class="fieldBox col_100">
                    <div class="label">简要记录</div>
                    <div class="field">
                         <span id="briefRec" name="briefRec"></span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">反馈记录</div>
                    <div class="field">
                         <span id="feedbackRec" name="feedbackRec"></span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">成因说明</div>
                    <div class="field">
                         <span id="rsnDesc" name="rsnDesc"></span>
                    </div>
                </div>          
                <!-- hide data -->
		        <div class="fieldBox col_100" style="display:none;">
		          <div class="field">
		              <input name="cId" id="cId" type="text" class="ui-textbox" value="${cId}">
		          </div>
		        </div>
            </div>
        </form>
	<script>
		$(function() {
			initForm();
	        initData();
		});
		
		frameElement.dialog.onCancel = function () {
			frameElement.dialog.close();
		}
		
		//初始化表单
		function initForm(){
			 $("#cst_comm_rec_form").ligerForm({
	                validate: true
	           });
		}
		
		//初始化数据
		function initData(){
			var cId = $("#cId").val();
	    	if(!cId)return;
	    	var wait_dialog= $.ligerDialog.SQalert({
	            content: LogUtils.LOG_CMM_LOADING,
	            SQ_type: "waitting",
	            onClose: function () {
	            }
	        });

	    	var _url = '<%=path%>/customer/cstcommrec/getById.do';
	    	$.ajax({
	    		type: 'get',
	    		dataType:'json',
	    		data:{id:cId},
	    		url: _url,
	    		success:function(msg){
	    			wait_dialog.close();
	    			 if(msg.success == 1){
	    				 setData(msg.data);//设置数据
	    			 }else{
	    				 $.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	    			 }
	    		}
	    	});
    	}
		
		//设置页面数据
	    function setData(data){
	    	$("#commDt").html(data.commDt);
	    	$("#commWayCd").html(data.commWayCdNm);
	    	$("#respPsn").html(data.respPsn);
	    	$("#linkman").html(data.linkman);
	    	$("#contactNum").html(data.contactNum);
	    	$("#briefRec").html(data.briefRec);
	    	$("#feedbackRec").html(data.feedbackRec);
	    	$("#rsnDesc").html(data.rsnDesc);
		};
	</script>
</body>
</html>